//判断用户是否登录
let id = localStorage.getItem('id')
function yan() {
    if (!id) {

    } else {
        var yonghu = document.querySelector('.dlzc')
        yonghu.innerText = "欢迎" + id
        yonghu.style.color = "red"
        var td = $("<button>")
        td.text('退出')
        $('.dlzc').after(td)
        td.on('click', function () {
            if (confirm('确定退出么')) {
                localStorage.removeItem('id')
                yonghu.innerText = "登录/注册"
                td.remove()
            }
        })
    }
}
yan()